import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void getScreenPix() {
  final physicalWidth = window.physicalSize.width;
  final physicalHeight = window.physicalSize.height;
  print('设备物理分辨率: $physicalWidth * $physicalHeight');
}

// 设备的逻辑分辨率
void getMediaPix(BuildContext context) {
  final width = MediaQuery.of(context).size.width;
  final height = MediaQuery.of(context).size.height;
  print('设备逻辑分辨率: $width * $height');
}

void getStausBar() {
  final dpr = window.devicePixelRatio;
//宽度和高度
  var physicalWidth, physicalHeight;
  final width = physicalWidth / dpr;
  final height = physicalHeight / dpr;
  print('屏幕宽高: $width * $height');

  final statusHeight = window.padding.top / dpr;
  print('状态栏的高度: $statusHeight');
}

void hideTopAndButtom(){
  SystemChrome.setEnabledSystemUIOverlays([]);
     
}
